const util = require('../../utils/util.js')
const app = getApp() // 获取app.js
Page({
  data: {
    item: {},
    api: app.globalData.api, // 全局的api赋给页面的api
    product: [],
  },
  onLoad: function (options) {
    util.alert(options.product)
    this.data.item.id = options.id  /**获取id */
    this.data.item.logo = options.logo
    this.data.item.price = options.price
    this.data.item.product = options.product
    this.setData(this.data)
  },
  toComment: function (e) {
    util.redirect({
      url: 'comment',
      id: this.data.item.id,  //  带着id 跳转
      product: this.data.item.product, // 产品名称
    })
  },
})